package com.zzj.bill.service.impl;

import java.util.List;

import com.zzj.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zzj.bill.mapper.ShopMapper;
import com.zzj.bill.domain.BillShop;
import com.zzj.bill.service.IShopService;

/**
 * shopService业务层处理
 *
 * @author ruoyi
 * @date 2022-01-26
 */
@Service
public class ShopServiceImpl implements IShopService
{
    @Autowired
    private ShopMapper shopMapper;

    /**
     * 查询shop
     *
     * @param id shop主键
     * @return shop
     */
    @Override
    public BillShop selectShopById(Integer id)
    {
        return shopMapper.selectShopById(id);
    }

    /**
     * 查询shop列表
     *
     * @param billShop shop
     * @return shop
     */
    @Override
    public List<BillShop> selectShopList(BillShop billShop)
    {
        return shopMapper.selectShopList(billShop);
    }

    /**
     * 新增shop
     *
     * @param billShop shop
     * @return 结果
     */
    @Override
    public int insertShop(BillShop billShop)
    {
        billShop.setCreateTime(DateUtils.getNowDate());
        return shopMapper.insertShop(billShop);
    }

    /**
     * 修改shop
     *
     * @param billShop shop
     * @return 结果
     */
    @Override
    public int updateShop(BillShop billShop)
    {
        billShop.setUpdateTime(DateUtils.getNowDate());
        return shopMapper.updateShop(billShop);
    }

    /**
     * 批量删除shop
     *
     * @param ids 需要删除的shop主键
     * @return 结果
     */
    @Override
    public int deleteShopByIds(Integer[] ids)
    {
        return shopMapper.deleteShopByIds(ids);
    }

    /**
     * 删除shop信息
     *
     * @param id shop主键
     * @return 结果
     */
    @Override
    public int deleteShopById(Integer id)
    {
        return shopMapper.deleteShopById(id);
    }

    @Override
    public List<BillShop> selectShopAll() {
        return shopMapper.selectShopList(new BillShop());
    }

    /**
     * 根据店铺ids 查询所有的店铺
     * @param shopIds
     * @return
     */
    @Override
    public List<BillShop> beathSelectByShopIds(List<Integer> shopIds) {
        return shopMapper.beathSelectByShopIds(shopIds);
    }
}
